import request from '@/utils/request';

// 获取问答列表
export const getQuestions = (params) => request({
  url: '/questions',
  params
})

// 添加问答
export const addQuestion = data => request({
  url: '/questions',
  method: 'post',
  data
})

// 删除问答
export const delQuestion = id => request({
  url: `/questions/${id}`,
  method: 'delete'
})

// 获取问题标签
export const getQuestionLabel = () => request({
  url: '/wd_label'
})

// 添加问题标签
export const addQuestionLabel = data => request({
  url: '/wd_label',
  method: 'post',
  data
})

// 删除问题标签
export const delQuestionLabel = id => request({
  url: `/wd_label/${id}`,
  method: 'delete'
})

// 根据条件获取问答列表
export const getCheck = params => request({
  url: '/questions',
  params
})

// 获取评论
export const getComment = () => request({
  url: '/comment'
})

// 根据条件获取问题标签
export const getCheckTab = id => request({
  url: `/wd_label/${id}`
})

// 根据条件修改问题标签
export const setCheckTab = data => request({
  url: `/wd_label/${data.id}`,
  method: 'put',
  data
})